home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Libraries / Views / Includes / UODPartView.h < prev    next >
Encoding:
Text File  |  1996-04-03  |  4.2 KB  |  158 lines  |  [TEXT/CWIE]

  1. //----------------------------------------------------------------------------------------
  2. // UODPartView.h
  3. // Copyright © 1994-96 by Apple Computer, Inc. All rights reserved.
  4. //----------------------------------------------------------------------------------------
  5.  
  6. #if qContainer
  7.  
  8. #ifndef __UODPARTVIEW__
  9. #define __UODPARTVIEW__
  10.  
  11. // CALib
  12.  
  13. #ifndef _CALIB_
  14. #include "CALib.h"
  15. #endif
  16.  
  17. // MacApp
  18.  
  19. #ifndef __UGEOMETRY__
  20. #include "UGeometry.h"
  21. #endif
  22.  
  23. #ifndef __ULISTITERATOR__
  24. #include "UListIterator.h"
  25. #endif
  26.  
  27.  
  28. //----------------------------------------------------------------------------------------
  29. // TODPartView
  30. //----------------------------------------------------------------------------------------
  31.  
  32. class TODPartView : public TView
  33. {
  34.     MA_DECLARE_CLASS;
  35.     
  36.     public:
  37.         TFileBasedDocument* fContainerDocument;
  38.         TODPartView();
  39.         virtual                         ~TODPartView();
  40.         virtual    void                IODPartView(TDocument* itsDocument,
  41.                                                                        TView* itsSuperView,
  42.                                                                     const VPoint& itsLocation,
  43.                                                                     const VPoint& itsSize,
  44.                                                                        SizeDeterminer itsHSizeDet,
  45.                                                                     SizeDeterminer itsVSizeDet,
  46.                                                                     CAFrameRef frameRef);
  47.         virtual    void                 DoPostCreate(TDocument* itsDocument);
  48.         virtual void                Draw(const VRect& area);
  49.         virtual void                ReadFrom(TStream* aStream);
  50.         virtual    void                SetFrame(const VRect& newFrame, Boolean invalidate);
  51.         virtual void                WriteTo(TStream* aStream);
  52.         virtual    CAFrameRef    GetFrameRef() const;
  53.         virtual    void                SetFrameRef(CAFrameRef newFrameRef);
  54.         
  55.         virtual void                AquirePartFromFile(FSSpec thePartFile);
  56.             //clone a frameRef from a source document.
  57.                 
  58.         virtual void                AquirePartFromDocument(CADocumentRef sourceDoc);
  59.             //clone a frameRef from a source document.
  60.         
  61.         virtual Boolean         NegotiateFrameChange(RgnHandle theRgn);
  62.             //ask the view if it is interested in the frame
  63.             //change request of the part.
  64.     
  65.         virtual void                 RemovePart();
  66.             //remove the embedded part
  67.             
  68.         virtual void                SizePartToView();
  69.             //force the part conform to the size of the view
  70.  
  71.         virtual    void                 SizeViewToPart();
  72.             //force the view conform to the size of the part
  73.         
  74.         virtual Boolean            HasPart();
  75.             //Does this view have an embedded part?
  76.             
  77.         virtual void                DoKeyEvent(TToolboxEvent* event);
  78.             //Handle the delete key.
  79.  
  80.         virtual void                DoSetupMenus();
  81.         
  82.         virtual void                 DoMenuCommand(CommandNumber aCommandNumber);
  83.         
  84.         virtual Boolean         WillAcceptDrop(CDragItemIterator& dragItemIterator);
  85.         virtual TCommand*        DoMakeDragDropCommand(CommandNumber         itsCommandNumber,
  86.                                                                                             CDragItemIterator&    dragItemIterator);
  87.                                                                                             
  88.         Boolean                    fSizePartToView; 
  89.                 //keeps the size of the view and the part in synch
  90.         Boolean                    fRejectFrameChangeRequests;
  91.                 //allows the application total control over frame size if false
  92.  
  93.     protected:
  94.         VPoint                    fCachedOrigin;
  95.         CAFrameRef            fFrameRef;
  96.         Boolean                    fHasPart;
  97.         
  98. };
  99.  
  100. //----------------------------------------------------------------------------------------
  101. // TODPartViewCommand:
  102. //----------------------------------------------------------------------------------------
  103.  
  104. class TODPartViewCommand : public TCommand
  105. {
  106.     MA_DECLARE_CLASS;
  107.  
  108. protected:
  109.     FSSpec                 fFileSpec;
  110.     TODPartView*     fODPartView; 
  111.     
  112. public:
  113.         TODPartViewCommand();
  114.             // Constructor
  115.             
  116.         void IODPartViewCommand(FSSpec            theFileSpec,
  117.                                         TODPartView*        thePartView,
  118.                                         CommandNumber        itsCommandNumber,
  119.                                         TCommandHandler*    itsContext,
  120.                                         Boolean                canUndo,
  121.                                         Boolean                causesChange,
  122.                                         TObject*            objectToNotify);
  123.         
  124.         virtual ~TODPartViewCommand();    
  125.  
  126.         virtual void DoIt();
  127.         
  128.         //virtual void UndoIt();
  129. };
  130.  
  131.  
  132. //----------------------------------------------------------------------------------------
  133. // CODPartViewIterator:
  134. //----------------------------------------------------------------------------------------
  135. class CODPartViewIterator : public CObjectIterator
  136. {
  137. public:
  138.  
  139.     CODPartViewIterator(TFileBasedDocument* theFBDocument, Boolean itsForward);
  140.  
  141.     CODPartViewIterator(TFileBasedDocument* theFBDocument);
  142.     
  143.     virtual ~CODPartViewIterator();
  144.     
  145.     TODPartView* CurrentODPartView();
  146.     
  147.     TODPartView* FirstODPartView();
  148.  
  149.     TODPartView* NextODPartView();
  150. };
  151.  
  152.  
  153. extern void InitUODPartView();
  154.  
  155.  
  156. #endif
  157. #endif //qContainer
  158.